/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "stdafx.h"
#include "../S_物体.h"
#include "面/Mesh.h"




S_GL立即模式::S_GL立即模式(S_设备环境& ctx) : m_Ctx(ctx), S_物体(E_物体类型::t_GL立即模式) {
	//S_VKMesh板载缓存* buf = new S_VKMesh板载缓存(ctx);
	m_Count = 0;
	m_当前物体 = 0;

}


void S_GL立即模式::glBegin(E_填充模式 模式) {
	if (m_Count >= m_Data.size()) {
		m_Data.push_back({});
		m_当前物体 = m_Data[m_Count];
		
	}
	
	++m_Count;

	switch (模式)
	{
	case E_填充模式::e_填充点:
		break;

	case E_填充模式::e_填充线:
		break;

	case E_填充模式::e_填充面:
		break;

	default:
		break;
	}
}

void S_GL立即模式::glEnd() {

}

void S_GL立即模式::glVertex(const vec3& v) {
	//f_buf_append板载缓存(m_当前网格缓存->m_顶点, v);
	m_Mask |= E_顶点标志位::e_顶点坐标;
}

void S_GL立即模式::glColor(const S_RGBA8UI& c) {

}

void S_GL立即模式::glNormal(const vec3& n) {

}

void S_GL立即模式::glCoord(const vec2& t) {

}




void S_GL立即模式::glMatrixPush() {

}

void S_GL立即模式::glMatrixPop() {

}

void S_GL立即模式::glClear() {
	/*f_buf_resize(0, 5, m_当前网格缓存->m_顶点,
		m_当前网格缓存->m_法线,
		m_当前网格缓存->m_颜色,
		m_当前网格缓存->m_UV1,
		m_当前网格缓存->m_索引);*/
}

void S_GL立即模式::f_绘制(S_渲染参数& 渲染参数) {
	/*for (auto& e : m_Data) {
		if (e.m_索引->m_Size) {
			S_索引渲染参数 索引参数;
			//S_板载缓存* 模型矩阵 = ((S_板载缓存*)渲染参数.m_矩阵);
			索引参数.m_索引 = (S_结构对象指针)e.m_索引;
			索引参数.m_间接 = 0;
			索引参数.m_绘制数量 = e.m_索引->m_Size;
			索引参数.m_实例数量 = 渲染参数.m_实例数量;
			索引参数.m_间接数量 = 0;

			f_Draw_索引三角形(m_Ctx, m_Material, e.m_顶点, 索引参数, 渲染参数);
		}
		else {
			f_Draw_序列(m_Ctx, m_Material, e.m_顶点, e.m_顶点->m_Size, 1, 渲染参数);
		}
	}*/
	
}






